<template>
  <div class="forbidden-container">
    <div class="forbidden-content">
      <el-result
        icon="error"
        title="403"
        sub-title="对不起，您没有权限访问该页面"
      >
        <template #extra>
          <el-button type="primary" @click="goBack">返回</el-button>
          <el-button type="primary" @click="goHome">回到首页</el-button>
        </template>
      </el-result>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from 'vue-router'

const router = useRouter()

const goBack = () => {
  router.go(-1)
}

const goHome = () => {
  router.push('/home')
}
</script>

<style scoped>
.forbidden-container {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--white-color);
}

.forbidden-content {
  text-align: center;
}
</style> 